package com.code.learn.Ipersistance.sqlSession;

import com.code.learn.Ipersistance.config.Configuration;

/**
 * @author Nina
 * @create 2020/12/8 下午3:02
 * @desc 默认的SqlSessionFactory实现类
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
    // 这里Configuration会一直传递下去，知道Executor执行jdbc，因为里面是包含有数据源以及其他的相关底层数据
    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSqlSession() {
        return new DefaultSqlSession(configuration);
    }
}
